from minio import Minio
from minio.error import S3Error
import os
# 创建一个MinIO客户端对象
def save(urls):
    client = Minio(
        "",  # MinIO服务器地址
        access_key="",  # 访问密钥
        secret_key="",  # 密钥密码
        secure=False  # 是否使用HTTPS
    )
    for url in urls:
        try:
            for str in url:
                print(str)
                client.fput_object("ksxt", str, str)
                os.remove(str)
        except S3Error as err:
            print("Error uploading file:", err)
def save_j(urls):
    client = Minio(
        "",  # MinIO服务器地址
        access_key="",  # 访问密钥
        secret_key="",  # 密钥密码
        secure=False  # 是否使用HTTPS
    )
    buckets = client.list_buckets()
    for url in urls:
        client.fput_object("ksxt", url, url)
        os.remove(url)
